﻿<%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true" CodeFile="tab_AD_Add.aspx.cs" Inherits="AdminCMS_tab_AD_Add" %>
<%@ Register Src="~/UIControls/WUC_DialogTextBox.ascx" TagName="WUC_DialogTextBox" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>添加广告</title>
<script type="text/javascript" src="js/UIMethod.js"></script>
</head>
<body style="text-align:center;">
<link id="mylink" href="css/style<%=UIMethod.GetStyleValue()%>.css" type="text/css" rel="stylesheet"/>

<form id="form1" runat="server">

<div style="width:570px;">
	<div class="title_right2" style="padding-left:35px; padding-top:5px; text-align:left;">
		<span class="title_maintxt"><b>添加广告</b></span>
	</div>	
	<table cellSpacing="0" cellPadding="0" width="100%" class="border">
		<tr>
			<td style="text-align:right; width:120px; height:30px;" class="tdbg_left">是否活动：</td>
			<td style="text-align:left;">
			
			<asp:DropDownList ID="adv_IsActive" runat="server">
			    <asp:ListItem Value="0" Selected="true">横幅广告</asp:ListItem>
			    <asp:ListItem Value="1">活动广告</asp:ListItem>
			</asp:DropDownList>	
			
			</td>
		</tr>
		<tr>
			<td style="text-align:right; width:120px; height:30px;" class="tdbg_left">广告名称：</td>
			<td style="text-align:left;">
			
			<asp:TextBox ID="adv_ADName" runat="server"></asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="adv_ADName"
        ErrorMessage="不能为空"></asp:RequiredFieldValidator>
			
			</td>
		</tr>
		<tr>
			<td style="text-align:right; width:120px; height:30px;" class="tdbg_left">文件路径：</td>
			<td style="text-align:left;">
			
			<uc1:WUC_DialogTextBox ID="adv_ImgUrl" runat="server" DialogHeight="180" DialogURL="../SControls/Image_Thumbnail.aspx" DialogWidth="300" DialogTitle="上传缩略图" ValidateNumber="false" Text="images/no_image.jpg" />
			
			</td>
		</tr>
		<tr>
			<td style="text-align:right; width:120px; height:30px;" class="tdbg_left">提示文字：</td>
			<td style="text-align:left;">
			
			<asp:TextBox ID="adv_LinkAlt" runat="server" Width="300px"></asp:TextBox>
			
			</td>
		</tr>
		<tr>
			<td style="text-align:right; width:120px; height:30px;" class="tdbg_left">广告类型：</td>
			<td style="text-align:left;">
			
			<asp:DropDownList ID="adv_ADType" runat="server" onchange="ADTypeOnchange(this.value);">
        <asp:ListItem Text="图片" Value="1" Selected="true"></asp:ListItem>
        <asp:ListItem Text="动画" Value="2"></asp:ListItem>
        <asp:ListItem Text="文本" Value="3"></asp:ListItem>
        <asp:ListItem Text="代码" Value="4"></asp:ListItem>
        <asp:ListItem Text="页面" Value="5"></asp:ListItem>        
    </asp:DropDownList>
			
			</td>
		</tr>
		<tr id="ad_1">
			<td style="text-align:right; width:120px; height:30px;" class="tdbg_left">广告宽度：</td>
			<td style="text-align:left;">
			
			<asp:TextBox ID="adv_ImgWidth" runat="server">720</asp:TextBox>
    <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="adv_ImgWidth"
        ErrorMessage="1至1024整数" MaximumValue="1024" MinimumValue="1" Type="Integer"></asp:RangeValidator>
			
			</td>
		</tr>
		<tr id="ad_2">
			<td style="text-align:right; width:120px; height:30px;" class="tdbg_left">广告高度：</td>
			<td style="text-align:left;">
			
			<asp:TextBox ID="adv_ImgHeight" runat="server">60</asp:TextBox>
    <asp:RangeValidator ID="RangeValidator2" runat="server" ControlToValidate="adv_ImgHeight"
        ErrorMessage="1至768整数" MaximumValue="768" MinimumValue="1" Type="Integer"></asp:RangeValidator>
			
			</td>
		</tr>
		<tr id="ad_3">
			<td style="text-align:right; width:120px; height:30px;" class="tdbg_left">文字代码：</td>
			<td style="text-align:left;">
			
			<asp:TextBox ID="adv_Description" runat="server" Height="80px" TextMode="MultiLine" Width="300px"></asp:TextBox>
			
			</td>
		</tr>
		<tr id="ad_4">
			<td style="text-align:right; width:120px; height:30px;" class="tdbg_left">是否透明：</td>
			<td style="text-align:left;">
			
			<asp:DropDownList ID="adv_FlashWmode" runat="server">
			    <asp:ListItem Text="否" Value="0" Selected="true"></asp:ListItem>
			    <asp:ListItem Text="是" Value="1"></asp:ListItem>
			</asp:DropDownList>	
			
			</td>
		</tr>
		<tr id="ad_5">
			<td style="text-align:right; width:120px; height:30px;" class="tdbg_left">链接网址：</td>
			<td style="text-align:left;">
			
			<asp:TextBox ID="adv_LinkUrl" runat="server" Width="300px"></asp:TextBox>
			
			</td>
		</tr>
		<tr>
			<td style="text-align:right; width:120px; height:30px;" class="tdbg_left">版位编号：</td>
			<td style="text-align:left;">
			
			    <asp:DropDownList runat="server" ID="adv_ZoneID"></asp:DropDownList>
			
			</td>
		</tr>
		<tr>
			<td style="text-align:right; width:120px; height:30px;" class="tdbg_left">链接目标：</td>
			<td style="text-align:left;">
			
			<asp:DropDownList ID="adv_LinkTarget" runat="server">
			    <asp:ListItem Value="0" Selected="true">原窗口</asp:ListItem>
			    <asp:ListItem Value="1">新窗口</asp:ListItem>
			</asp:DropDownList>
			
			</td>
		</tr>
		<tr>
			<td style="text-align:right; width:120px; height:30px;" class="tdbg_left">是否统计：</td>
			<td style="text-align:left;">
			
			<asp:DropDownList ID="adv_CountView" runat="server">
			    <asp:ListItem Text="否" Value="0" Selected="true"></asp:ListItem>
			    <asp:ListItem Text="是" Value="1"></asp:ListItem>
			</asp:DropDownList>	
			
			</td>
		</tr>
		<tr>
			<td></td>
			<td style="text-align:left; height:50px;">
			<asp:Button ID="btn_submit" runat="server" Text="确定" OnClick="btn_submit_Click" />
			</td>
		</tr>
	</table>
<!--阴影-->
	<div style="width:98%;" class="tdbg_left2">
	</div>
	<!--阴影end-->
</div>
</form>
</body>
</html>
<script type="text/javascript">
function TypeEvent()
{
    //隐掉所有
    for(var i = 1; i <= 5; i++)
    {
        document.getElementById('ad_' + i).style.display = 'none';
    }
    //显示指定
    for(var i=0;i<arguments.length;i++)
    {        
        document.getElementById('ad_' + arguments[i]).style.display = '';
    }
}
function ADTypeOnchange(selIndex)
{
    switch(selIndex)
    {
        case '1'://图片
            TypeEvent('1','2','5');
            break;
        case '2'://动画
            TypeEvent('1','2','4','5');
            break;
        case '3'://文本
            TypeEvent('3');
            break;
        case '4'://代码
            TypeEvent('3');
            break;
        case '5'://页面
            TypeEvent('5');
            break;
    }
}
ADTypeOnchange(document.getElementById('ddl_ADType').value);
</script>
